package geguol.cc.widgetapplication.widget;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.LinearLayout;
import android.widget.TextView;

import java.util.ArrayList;
import java.util.List;

import geguol.cc.widgetapplication.R;
import geguol.cc.widgetapplication.bean.EmotionBean;

/**
 * 作者  格锅
 * 时间  2017/4/20 16:04
 * 文件  WidgetApplication
 * 描述  统计
 */

public class FaceStatisticsLayout extends LinearLayout {
	private List<TextView> viewList = new ArrayList<>();
	public FaceStatisticsLayout(Context context) {
		super(context);
		init();
	}

	public FaceStatisticsLayout(Context context, AttributeSet attrs) {
		super(context, attrs);
		init();
	}

	private void init() {
		LayoutInflater layoutInflater =  (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
		layoutInflater.inflate(R.layout.face_linerlayout, this,true);
		TextView textView1 = (TextView) findViewById(R.id.face1);
		TextView textView2 = (TextView) findViewById(R.id.face2);
		TextView textView3 = (TextView) findViewById(R.id.face3);
		TextView textView4 = (TextView) findViewById(R.id.face4);
		TextView textView5 = (TextView) findViewById(R.id.face5);
		viewList.add(textView1);
		viewList.add(textView2);
		viewList.add(textView3);
		viewList.add(textView4);
		viewList.add(textView5);
	}

	public void setDate(List<EmotionBean> date){
		for (int i = 0; i < date.size(); i++) {
			if (viewList.get(i) != null) {
				viewList.get(i).setText(date.get(i).count+"");
			}
		}
	}



}
